/**
 * Software License, Version 1.0
 * 
 * Copyright 2003 The Trustees of Indiana University.  All rights reserved.
 * 
 *
 *Redistribution and use in source and binary forms, with or without 
 *modification, are permitted provided that the following conditions are met:
 *
 *1) All redistributions of source code must retain the above copyright notice,
 * the list of authors in the original source code, this list of conditions and
 * the disclaimer listed in this license;
 *2) All redistributions in binary form must reproduce the above copyright 
 * notice, this list of conditions and the disclaimer listed in this license in
 * the documentation and/or other materials provided with the distribution;
 *3) Any documentation included with all redistributions must include the 
 * following acknowledgement:
 *
 *"This product includes software developed by the Community Grids Lab. For 
 * further information contact the Community Grids Lab at 
 * http://communitygrids.iu.edu/."
 *
 * Alternatively, this acknowledgement may appear in the software itself, and 
 * wherever such third-party acknowledgments normally appear.
 * 
 *4) The name Indiana University or Community Grids Lab or NaradaBrokering, 
 * shall not be used to endorse or promote products derived from this software 
 * without prior written permission from Indiana University.  For written 
 * permission, please contact the Advanced Research and Technology Institute 
 * ("ARTI") at 351 West 10th Street, Indianapolis, Indiana 46202.
 *5) Products derived from this software may not be called NaradaBrokering, 
 * nor may Indiana University or Community Grids Lab or NaradaBrokering appear
 * in their name, without prior written permission of ARTI.
 * 
 *
 * Indiana University provides no reassurances that the source code provided 
 * does not infringe the patent or any other intellectual property rights of 
 * any other entity.  Indiana University disclaims any liability to any 
 * recipient for claims brought by any other entity based on infringement of 
 * intellectual property rights or otherwise.  
 *
 *LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH NO 
 *WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA UNIVERSITY GIVES
 *NO WARRANTIES AND MAKES NO REPRESENTATION THAT SOFTWARE IS FREE OF 
 *INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER PROPRIETARY RIGHTS. 
 *INDIANA UNIVERSITY MAKES NO WARRANTIES THAT SOFTWARE IS FREE FROM "BUGS", 
 *"VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", OR OTHER HARMFUL CODE.  
 *LICENSEE ASSUMES THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
 *ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION 
 *GENERATED USING SOFTWARE.
 */
/*
 * An XML document type.
 * Localname: SequenceAcknowledgement
 * Namespace: http://schemas.xmlsoap.org/ws/2004/03/rm
 * Java type: cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.wsrm.impl;
/**
 * A document containing one SequenceAcknowledgement(@http://schemas.xmlsoap.org/ws/2004/03/rm) element.
 *
 * This is a complex type.
 */
public class SequenceAcknowledgementDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument
{
    
    public SequenceAcknowledgementDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SEQUENCEACKNOWLEDGEMENT$0 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "SequenceAcknowledgement");
    
    
    /**
     * Gets the "SequenceAcknowledgement" element
     */
    public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement getSequenceAcknowledgement()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement)get_store().find_element_user(SEQUENCEACKNOWLEDGEMENT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SequenceAcknowledgement" element
     */
    public void setSequenceAcknowledgement(cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement sequenceAcknowledgement)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement)get_store().find_element_user(SEQUENCEACKNOWLEDGEMENT$0, 0);
            if (target == null)
            {
                target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement)get_store().add_element_user(SEQUENCEACKNOWLEDGEMENT$0);
            }
            target.set(sequenceAcknowledgement);
        }
    }
    
    /**
     * Appends and returns a new empty "SequenceAcknowledgement" element
     */
    public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement addNewSequenceAcknowledgement()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement)get_store().add_element_user(SEQUENCEACKNOWLEDGEMENT$0);
            return target;
        }
    }
    /**
     * An XML SequenceAcknowledgement(@http://schemas.xmlsoap.org/ws/2004/03/rm).
     *
     * This is a complex type.
     */
    public static class SequenceAcknowledgementImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement
    {
        
        public SequenceAcknowledgementImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName IDENTIFIER$0 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2002/07/utility", "Identifier");
        private static final javax.xml.namespace.QName ACKNOWLEDGEMENTRANGE$2 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "AcknowledgementRange");
        private static final javax.xml.namespace.QName NACK$4 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "Nack");
        
        
        /**
         * Gets the "Identifier" element
         */
        public cgl.narada.wsinfra.schemas.utility.AttributedURI getIdentifier()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.utility.AttributedURI target = null;
                target = (cgl.narada.wsinfra.schemas.utility.AttributedURI)get_store().find_element_user(IDENTIFIER$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "Identifier" element
         */
        public void setIdentifier(cgl.narada.wsinfra.schemas.utility.AttributedURI identifier)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.utility.AttributedURI target = null;
                target = (cgl.narada.wsinfra.schemas.utility.AttributedURI)get_store().find_element_user(IDENTIFIER$0, 0);
                if (target == null)
                {
                    target = (cgl.narada.wsinfra.schemas.utility.AttributedURI)get_store().add_element_user(IDENTIFIER$0);
                }
                target.set(identifier);
            }
        }
        
        /**
         * Appends and returns a new empty "Identifier" element
         */
        public cgl.narada.wsinfra.schemas.utility.AttributedURI addNewIdentifier()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.utility.AttributedURI target = null;
                target = (cgl.narada.wsinfra.schemas.utility.AttributedURI)get_store().add_element_user(IDENTIFIER$0);
                return target;
            }
        }
        
        /**
         * Gets array of all "AcknowledgementRange" elements
         */
        public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] getAcknowledgementRangeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(ACKNOWLEDGEMENTRANGE$2, targetList);
                cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] result = new cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "AcknowledgementRange" element
         */
        public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange getAcknowledgementRangeArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange)get_store().find_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "AcknowledgementRange" element
         */
        public int sizeOfAcknowledgementRangeArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ACKNOWLEDGEMENTRANGE$2);
            }
        }
        
        /**
         * Sets array of all "AcknowledgementRange" element
         */
        public void setAcknowledgementRangeArray(cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] acknowledgementRangeArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(acknowledgementRangeArray, ACKNOWLEDGEMENTRANGE$2);
            }
        }
        
        /**
         * Sets ith "AcknowledgementRange" element
         */
        public void setAcknowledgementRangeArray(int i, cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange acknowledgementRange)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange)get_store().find_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(acknowledgementRange);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "AcknowledgementRange" element
         */
        public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange insertNewAcknowledgementRange(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange)get_store().insert_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "AcknowledgementRange" element
         */
        public cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange addNewAcknowledgementRange()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange)get_store().add_element_user(ACKNOWLEDGEMENTRANGE$2);
                return target;
            }
        }
        
        /**
         * Removes the ith "AcknowledgementRange" element
         */
        public void removeAcknowledgementRange(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ACKNOWLEDGEMENTRANGE$2, i);
            }
        }
        
        /**
         * Gets array of all "Nack" elements
         */
        public java.math.BigInteger[] getNackArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(NACK$4, targetList);
                java.math.BigInteger[] result = new java.math.BigInteger[targetList.size()];
                for (int i = 0, len = targetList.size() ; i < len ; i++)
                    result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getBigIntegerValue();
                return result;
            }
        }
        
        /**
         * Gets ith "Nack" element
         */
        public java.math.BigInteger getNackArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NACK$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target.getBigIntegerValue();
            }
        }
        
        /**
         * Gets (as xml) array of all "Nack" elements
         */
        public org.apache.xmlbeans.XmlUnsignedLong[] xgetNackArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(NACK$4, targetList);
                org.apache.xmlbeans.XmlUnsignedLong[] result = new org.apache.xmlbeans.XmlUnsignedLong[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets (as xml) ith "Nack" element
         */
        public org.apache.xmlbeans.XmlUnsignedLong xgetNackArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlUnsignedLong target = null;
                target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_element_user(NACK$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return (org.apache.xmlbeans.XmlUnsignedLong)target;
            }
        }
        
        /**
         * Returns number of "Nack" element
         */
        public int sizeOfNackArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(NACK$4);
            }
        }
        
        /**
         * Sets array of all "Nack" element
         */
        public void setNackArray(java.math.BigInteger[] nackArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(nackArray, NACK$4);
            }
        }
        
        /**
         * Sets ith "Nack" element
         */
        public void setNackArray(int i, java.math.BigInteger nack)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NACK$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.setBigIntegerValue(nack);
            }
        }
        
        /**
         * Sets (as xml) array of all "Nack" element
         */
        public void xsetNackArray(org.apache.xmlbeans.XmlUnsignedLong[]nackArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(nackArray, NACK$4);
            }
        }
        
        /**
         * Sets (as xml) ith "Nack" element
         */
        public void xsetNackArray(int i, org.apache.xmlbeans.XmlUnsignedLong nack)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlUnsignedLong target = null;
                target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_element_user(NACK$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(nack);
            }
        }
        
        /**
         * Inserts the value as the ith "Nack" element
         */
        public void insertNack(int i, java.math.BigInteger nack)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = 
                    (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(NACK$4, i);
                target.setBigIntegerValue(nack);
            }
        }
        
        /**
         * Appends the value as the last "Nack" element
         */
        public void addNack(java.math.BigInteger nack)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NACK$4);
                target.setBigIntegerValue(nack);
            }
        }
        
        /**
         * Removes the ith "Nack" element
         */
        public void removeNack(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(NACK$4, i);
            }
        }
        /**
         * An XML AcknowledgementRange(@http://schemas.xmlsoap.org/ws/2004/03/rm).
         *
         * This is a complex type.
         */
        public static class AcknowledgementRangeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.wsrm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange
        {
            
            public AcknowledgementRangeImpl(org.apache.xmlbeans.SchemaType sType)
            {
                super(sType);
            }
            
            private static final javax.xml.namespace.QName UPPER$0 = 
                new javax.xml.namespace.QName("", "Upper");
            private static final javax.xml.namespace.QName LOWER$2 = 
                new javax.xml.namespace.QName("", "Lower");
            
            
            /**
             * Gets the "Upper" attribute
             */
            public java.math.BigInteger getUpper()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(UPPER$0);
                    if (target == null)
                    {
                      return null;
                    }
                    return target.getBigIntegerValue();
                }
            }
            
            /**
             * Gets (as xml) the "Upper" attribute
             */
            public org.apache.xmlbeans.XmlUnsignedLong xgetUpper()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_attribute_user(UPPER$0);
                    return target;
                }
            }
            
            /**
             * Sets the "Upper" attribute
             */
            public void setUpper(java.math.BigInteger upper)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(UPPER$0);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(UPPER$0);
                    }
                    target.setBigIntegerValue(upper);
                }
            }
            
            /**
             * Sets (as xml) the "Upper" attribute
             */
            public void xsetUpper(org.apache.xmlbeans.XmlUnsignedLong upper)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_attribute_user(UPPER$0);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().add_attribute_user(UPPER$0);
                    }
                    target.set(upper);
                }
            }
            
            /**
             * Gets the "Lower" attribute
             */
            public java.math.BigInteger getLower()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LOWER$2);
                    if (target == null)
                    {
                      return null;
                    }
                    return target.getBigIntegerValue();
                }
            }
            
            /**
             * Gets (as xml) the "Lower" attribute
             */
            public org.apache.xmlbeans.XmlUnsignedLong xgetLower()
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_attribute_user(LOWER$2);
                    return target;
                }
            }
            
            /**
             * Sets the "Lower" attribute
             */
            public void setLower(java.math.BigInteger lower)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LOWER$2);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LOWER$2);
                    }
                    target.setBigIntegerValue(lower);
                }
            }
            
            /**
             * Sets (as xml) the "Lower" attribute
             */
            public void xsetLower(org.apache.xmlbeans.XmlUnsignedLong lower)
            {
                synchronized (monitor())
                {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().find_attribute_user(LOWER$2);
                    if (target == null)
                    {
                      target = (org.apache.xmlbeans.XmlUnsignedLong)get_store().add_attribute_user(LOWER$2);
                    }
                    target.set(lower);
                }
            }
        }
    }
}
